<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>

    <title>添加更新考试</title>
    <!-- Bootstrap core CSS -->
    <link href="../static/asserts/css/bootstrap.min.css" th:href="@{/asserts/css/bootstrap.min.css}" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="../static/asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
    <style type="text/css">
        /* Chart.js */

        @-webkit-keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        @keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        .chartjs-render-monitor {
            -webkit-animation: chartjs-render-animation 0.001s;
            animation: chartjs-render-animation 0.001s;
        }
    </style>
</head>

<body>
<div th:replace="sidbar::#topbar"></div>

<div class="container-fluid">
    <div class="row">
        <div th:replace="sidbar::#sbar(activeUri='main.html')"></div>

        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <div class="chartjs-size-monitor"
                 style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: hidden; pointer-events: none; visibility: hidden; z-index: -1;">
                <div class="chartjs-size-monitor-expand"
                     style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;">
                    <div style="position:absolute;width:1000000px;height:1000000px;left:0;top:0"></div>
                </div>
                <div class="chartjs-size-monitor-shrink"
                     style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;">
                    <div style="position:absolute;width:200%;height:200%;left:0; top:0"></div>
                </div>
            </div>

            <form th:if="${type=='insert'}" class="form-horizontal" th:action="@{/exam/insert}" method="post"
                  style="border: 1px gray solid;width: 600px;margin:auto;background: #c7c4ff">
                <h2 style="text-align: center">添加考试</h2>
                <div class="form-group">
                    <label for="subjects" class="col-sm-2 control-label">考试科目：</label>
                    <div class="col-sm-10">
                        <input type="text" name="subjects" class="form-control" id="subjects" th:required
                               th:placeholder="考试科目">
                    </div>
                </div>
                <div class="form-group">
                    <label for="eDate" class="col-sm-3 control-label">考试日期：</label>
                    <div class="col-sm-10">
                        <input type="date"  name="eDate" class="form-control" id="eDate" th:required
                               >
                    </div>
                </div>
                <!--						学分-->
                <div class="form-group">
                    <label for="score" class="col-sm-2 control-label">学分：</label>
                    <div class="col-sm-10">
                        <input type="text" name="score" class="form-control" id="score" th:required
                               th:placeholder="学分">
                    </div>
                </div>
                <div class="form-group">
                    <label for="time" class="col-sm-3 control-label">考试时长：</label>
                    <div class="col-sm-10">
                        <input type="text" name="time" class="form-control" id="time" th:required
                               th:placeholder="考试时长-单位分钟">
                    </div>
                </div>

                <br>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10" style="margin-left: 130px">
                        <input type="submit" class="btn btn-default" value="添加考试"/>
                        <a th:href="@{/exam/list}" style="margin-left: 80px"
                           th:text="返回"></a>
                    </div>
                </div>
            </form>


            <form th:if="${type=='update'}" class="form-horizontal" th:action="@{/exam/update}" method="post"
                  style="border: 1px gray solid;width: 600px;margin:auto;background: #c7c4ff">
                <h2 style="text-align: center">更新考试</h2>
                <input type="text" th:value="${exam.getId()}" name="id" hidden>
                <div class="form-group">
                    <label for="subjects1" class="col-sm-2 control-label">考试科目：</label>
                    <div class="col-sm-10">
                        <input type="text" th:value="${exam.getSubjects()}" name="subjects" class="form-control" id="subjects1" th:required
                               th:placeholder="考试科目">
                    </div>
                </div>
                <div class="form-group">
                    <label for="eDate1" class="col-sm-8 control-label" th:text="${#dates.format(exam.getEDate(),'考试日期,默认'+'yyyy-MM-dd')}"></label>
                    <div class="col-sm-10">
                        <input type="date" th:value="${#dates.format(exam.getEDate(),'yyyy-MM-dd')}" name="eDate" class="form-control" id="eDate1" th:required>
                    </div>
                </div>
                <!--						学分-->
                <div class="form-group">
                    <label for="score1" class="col-sm-2 control-label">学分：</label>
                    <div class="col-sm-10">
                        <input type="text" th:value="${exam.getScore()}" name="score" class="form-control" id="score1" th:required
                               th:placeholder="学分">
                    </div>
                </div>
                <div class="form-group">
                    <label for="time1" class="col-sm-3 control-label">考试时长：</label>
                    <div class="col-sm-10">
                        <input type="text" th:value="${exam.getTime()}" name="time" class="form-control" id="time1" th:required
                               th:placeholder="考试时长-单位分钟">
                    </div>
                </div>
                <br>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10" style="margin-left: 130px">
                        <input type="submit" class="btn btn-default" value="更新考试"/>
                        <a th:href="@{/exam/list}" style="margin-left: 80px"
                           th:text="返回"></a>
                    </div>
                </div>
            </form>

        </main>
    </div>
</div>


</body>

</html>